
/**
 * <copyright>
 * </copyright>
 *
 * $Id$
 */
package Apusic.impl;

import Apusic.Application;
import Apusic.ApusicPackage;

import org.eclipse.emf.common.notify.Notification;

import org.eclipse.emf.ecore.EClass;

import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.emf.ecore.impl.EObjectImpl;
import javax.management.ObjectName;
import org.eclipse.emf.ecore.EObject;
import com.apusic.admin.config.*;
import com.apusic.admin.*;

import cn.edu.pku.sei.ra.wrapping.CommonWrapping.WrappingEObject;
import cn.edu.pku.sei.ra.wrapping.CommonWrapping.impl.WrappingEObjectImpl;
import cn.edu.pku.sei.ra.wrapping.CommonWrapping.util.EObjectContainmentEListForWrapping;
import cn.edu.pku.sei.ra.wrapping.CommonWrapping.util.EObjectResolvingEListForWrapping;
import cn.edu.pku.sei.ra.wrapping.CommonWrapping.util.ImagePool;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import java.util.Set;
/**
 * <!-- begin-user-doc -->
 * An implementation of the model object '<em><b>Application</b></em>'.
 * <!-- end-user-doc -->
 * <p>
 * The following features are implemented:
 * <ul>
 *   <li>{@link Apusic.impl.ApplicationImpl#getAppName <em>App Name</em>}</li>
 *   <li>{@link Apusic.impl.ApplicationImpl#getJ2eeType <em>J2ee Type</em>}</li>
 *   <li>{@link Apusic.impl.ApplicationImpl#getStateString <em>State String</em>}</li>
 *   <li>{@link Apusic.impl.ApplicationImpl#getContextRoot <em>Context Root</em>}</li>
 *   <li>{@link Apusic.impl.ApplicationImpl#getDeployPath <em>Deploy Path</em>}</li>
 * </ul>
 * </p>
 *
 * @generated
 */
public class ApplicationImpl extends WrappingEObjectImpl implements Application
{
  /**
   * The default value of the '{@link #getAppName() <em>App Name</em>}' attribute.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #getAppName()
   * @generated
   * @ordered
   */
  protected static final String APP_NAME_EDEFAULT = null;

  /**
   * The cached value of the '{@link #getAppName() <em>App Name</em>}' attribute.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #getAppName()
   * @generated
   * @ordered
   */
  protected String appName = APP_NAME_EDEFAULT;

  /**
   * The default value of the '{@link #getJ2eeType() <em>J2ee Type</em>}' attribute.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #getJ2eeType()
   * @generated
   * @ordered
   */
  protected static final String J2EE_TYPE_EDEFAULT = null;

  /**
   * The cached value of the '{@link #getJ2eeType() <em>J2ee Type</em>}' attribute.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #getJ2eeType()
   * @generated
   * @ordered
   */
  protected String j2eeType = J2EE_TYPE_EDEFAULT;

  /**
   * The default value of the '{@link #getStateString() <em>State String</em>}' attribute.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #getStateString()
   * @generated
   * @ordered
   */
  protected static final String STATE_STRING_EDEFAULT = null;

  /**
   * The cached value of the '{@link #getStateString() <em>State String</em>}' attribute.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #getStateString()
   * @generated
   * @ordered
   */
  protected String stateString = STATE_STRING_EDEFAULT;

  /**
   * The default value of the '{@link #getContextRoot() <em>Context Root</em>}' attribute.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #getContextRoot()
   * @generated
   * @ordered
   */
  protected static final String CONTEXT_ROOT_EDEFAULT = null;

  /**
   * The cached value of the '{@link #getContextRoot() <em>Context Root</em>}' attribute.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #getContextRoot()
   * @generated
   * @ordered
   */
  protected String contextRoot = CONTEXT_ROOT_EDEFAULT;

  /**
   * The default value of the '{@link #getDeployPath() <em>Deploy Path</em>}' attribute.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #getDeployPath()
   * @generated
   * @ordered
   */
  protected static final String DEPLOY_PATH_EDEFAULT = null;

  /**
   * The cached value of the '{@link #getDeployPath() <em>Deploy Path</em>}' attribute.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #getDeployPath()
   * @generated
   * @ordered
   */
  protected String deployPath = DEPLOY_PATH_EDEFAULT;

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  protected ApplicationImpl()
  {
    super();
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  protected EClass eStaticClass()
  {
    return ApusicPackage.Literals.APPLICATION;
  }

  
  

  
  
  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */ 
   public boolean isForCore(Object arg0){
   	boolean result=true;
   	if(core==null) return false;
    try{
    if(core!=null && ((ApplicationConfig)core).getAppName().equals(((ApplicationConfig)arg0).getAppName()))
  result=true;
else
  result=false;
    }
    catch(Exception e){
      result=false;
    }
    return result;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */ 
  public List listSubCores(int featureID){
    List result=new ArrayList();
  
    ApplicationConfig core=(ApplicationConfig)this.getCore();
    if(core==null) 
      return result;
    switch(featureID){
    
  
  
  
  
  
  }
    return result;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */ 
  public EClass getChildClassMap(Object object){
    ApusicPackage pack=ApusicPackage.eINSTANCE;	
  
  
  
  
  
  
    return null;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public String getAppName()
  {
        Object result=null;
        ApplicationConfig core=(ApplicationConfig)getCore();
        if(core==null) return appName;	
        try
{
appName=core.getAppName();
}
catch(Exception e)
{
  appName = null;
}
    return appName; 
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public void setAppName(String newAppName)
  {
    String oldAppName = appName;
    appName = newAppName;
        	
      ApplicationConfig core=(ApplicationConfig)getCore();
      if(core==null) return;
      	
        
    if (eNotificationRequired())
      eNotify(new ENotificationImpl(this, Notification.SET, ApusicPackage.APPLICATION__APP_NAME, oldAppName, appName));
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public String getJ2eeType()
  {
        Object result=null;
        ApplicationConfig core=(ApplicationConfig)getCore();
        if(core==null) return j2eeType;	
        try
{
j2eeType=core.getJ2eeType();
}
catch(Exception e)
{
  j2eeType = null;
}
    return j2eeType; 
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public void setJ2eeType(String newJ2eeType)
  {
    String oldJ2eeType = j2eeType;
    j2eeType = newJ2eeType;
        	
      ApplicationConfig core=(ApplicationConfig)getCore();
      if(core==null) return;
      	
        
    if (eNotificationRequired())
      eNotify(new ENotificationImpl(this, Notification.SET, ApusicPackage.APPLICATION__J2EE_TYPE, oldJ2eeType, j2eeType));
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public String getStateString()
  {
        Object result=null;
        ApplicationConfig core=(ApplicationConfig)getCore();
        if(core==null) return stateString;	
        try
{
stateString=core.getStateString();
}
catch(Exception e)
{
  stateString = null;
}
    return stateString; 
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public void setStateString(String newStateString)
  {
    String oldStateString = stateString;
    stateString = newStateString;
        	
      ApplicationConfig core=(ApplicationConfig)getCore();
      if(core==null) return;
      	
        
    if (eNotificationRequired())
      eNotify(new ENotificationImpl(this, Notification.SET, ApusicPackage.APPLICATION__STATE_STRING, oldStateString, stateString));
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public String getContextRoot()
  {
        Object result=null;
        ApplicationConfig core=(ApplicationConfig)getCore();
        if(core==null) return contextRoot;	
        try
{
contextRoot=core.getContextRoot();
}
catch(Exception e)
{
  contextRoot = null;
}
    return contextRoot; 
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public void setContextRoot(String newContextRoot)
  {
    String oldContextRoot = contextRoot;
    contextRoot = newContextRoot;
        	
      ApplicationConfig core=(ApplicationConfig)getCore();
      if(core==null) return;
      	
        
    if (eNotificationRequired())
      eNotify(new ENotificationImpl(this, Notification.SET, ApusicPackage.APPLICATION__CONTEXT_ROOT, oldContextRoot, contextRoot));
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public String getDeployPath()
  {
        Object result=null;
        ApplicationConfig core=(ApplicationConfig)getCore();
        if(core==null) return deployPath;	
        try
{
deployPath=core.getDeployPath();
}
catch(Exception e)
{
  deployPath = null;
}
    return deployPath; 
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public void setDeployPath(String newDeployPath)
  {
    String oldDeployPath = deployPath;
    deployPath = newDeployPath;
        	
      ApplicationConfig core=(ApplicationConfig)getCore();
      if(core==null) return;
      	
        
    if (eNotificationRequired())
      eNotify(new ENotificationImpl(this, Notification.SET, ApusicPackage.APPLICATION__DEPLOY_PATH, oldDeployPath, deployPath));
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public Object eGet(int featureID, boolean resolve, boolean coreType)
  {
    switch (featureID)
    {
      case ApusicPackage.APPLICATION__APP_NAME:
        return getAppName();
      case ApusicPackage.APPLICATION__J2EE_TYPE:
        return getJ2eeType();
      case ApusicPackage.APPLICATION__STATE_STRING:
        return getStateString();
      case ApusicPackage.APPLICATION__CONTEXT_ROOT:
        return getContextRoot();
      case ApusicPackage.APPLICATION__DEPLOY_PATH:
        return getDeployPath();
    }
    return super.eGet(featureID, resolve, coreType);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public void eSet(int featureID, Object newValue)
  {
    switch (featureID)
    {
      case ApusicPackage.APPLICATION__APP_NAME:
        setAppName((String)newValue);
        return;
      case ApusicPackage.APPLICATION__J2EE_TYPE:
        setJ2eeType((String)newValue);
        return;
      case ApusicPackage.APPLICATION__STATE_STRING:
        setStateString((String)newValue);
        return;
      case ApusicPackage.APPLICATION__CONTEXT_ROOT:
        setContextRoot((String)newValue);
        return;
      case ApusicPackage.APPLICATION__DEPLOY_PATH:
        setDeployPath((String)newValue);
        return;
    }
    super.eSet(featureID, newValue);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public void eUnset(int featureID)
  {
    switch (featureID)
    {
      case ApusicPackage.APPLICATION__APP_NAME:
        setAppName(APP_NAME_EDEFAULT);
        return;
      case ApusicPackage.APPLICATION__J2EE_TYPE:
        setJ2eeType(J2EE_TYPE_EDEFAULT);
        return;
      case ApusicPackage.APPLICATION__STATE_STRING:
        setStateString(STATE_STRING_EDEFAULT);
        return;
      case ApusicPackage.APPLICATION__CONTEXT_ROOT:
        setContextRoot(CONTEXT_ROOT_EDEFAULT);
        return;
      case ApusicPackage.APPLICATION__DEPLOY_PATH:
        setDeployPath(DEPLOY_PATH_EDEFAULT);
        return;
    }
    super.eUnset(featureID);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public boolean eIsSet(int featureID)
  {
    switch (featureID)
    {
      case ApusicPackage.APPLICATION__APP_NAME:
        return APP_NAME_EDEFAULT == null ? appName != null : !APP_NAME_EDEFAULT.equals(appName);
      case ApusicPackage.APPLICATION__J2EE_TYPE:
        return J2EE_TYPE_EDEFAULT == null ? j2eeType != null : !J2EE_TYPE_EDEFAULT.equals(j2eeType);
      case ApusicPackage.APPLICATION__STATE_STRING:
        return STATE_STRING_EDEFAULT == null ? stateString != null : !STATE_STRING_EDEFAULT.equals(stateString);
      case ApusicPackage.APPLICATION__CONTEXT_ROOT:
        return CONTEXT_ROOT_EDEFAULT == null ? contextRoot != null : !CONTEXT_ROOT_EDEFAULT.equals(contextRoot);
      case ApusicPackage.APPLICATION__DEPLOY_PATH:
        return DEPLOY_PATH_EDEFAULT == null ? deployPath != null : !DEPLOY_PATH_EDEFAULT.equals(deployPath);
    }
    return super.eIsSet(featureID);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public String toString()
  {
    if (eIsProxy()) return super.toString();

    StringBuffer result = new StringBuffer(super.toString());
    result.append(" (appName: ");
    result.append(appName);
    result.append(", j2eeType: ");
    result.append(j2eeType);
    result.append(", stateString: ");
    result.append(stateString);
    result.append(", contextRoot: ");
    result.append(contextRoot);
    result.append(", deployPath: ");
    result.append(deployPath);
    result.append(')');
    return result.toString();
  }

} //ApplicationImpl
